package com.lcb.spring.processor;

import com.lcb.spring.bean.Car;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanFactoryPostProcessor;
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
import org.springframework.beans.factory.support.GenericBeanDefinition;
import org.springframework.stereotype.Component;

//@Component
public class LcbBeanFactoryPostProcessor implements BeanFactoryPostProcessor {

    public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException {
        GenericBeanDefinition c = (GenericBeanDefinition) beanFactory.getBeanDefinition("c");
        System.out.println(c.getBeanClass());
        System.out.println(c.getBeanClassName());
        c.setBeanClass(Car.class);
    }
}
